package com.istock.union.user.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 用户登录的存储模型
 * 
 * @author senvon
 *
 */
public class SSOUser {

	/**
	 * 用户真实名字,数据表中的USER_NAME字段
	 */
	private String userName;
	/**
	 * 租户号
	 */
	private String tenantNo;
	/**
	 * 用户的登录名.
	 */
	private String loginName;
	
	/**
	 * 登录以后,获得的token
	 */
	private String token;
	
	/**
	 * 用户在表中的ID
	 */
	private String userId;
	
	/**
	 * 当前登录的身份ID
	 */
	private String credentialId;
	/**
	 * 当前用户登录的机构
	 * 如果用户出现委任,当前字段会和ownDept不一致
	 */
	private UserDept currentDept;
	
	/**
	 * 用户的所属机构,原本在user表中所属的用户
	 */
	private UserDept ownDept;
	
	/**
	 * 委派的数量
	 */
	private Integer jobCount;
	/**
	 * 当前用户登录的角色信息
	 */
	private List<UserRole> roleInfoSet = new ArrayList<UserRole>();
	
	/**
	 * 当前用户的权限标识列表
	 */
	private Set<String> permissions = new HashSet<String>();
	
	/**
	 * 用户表的扩展字段
	 */
	private Map<String , String> paramMap = new HashMap<String , String>();
	
	/**
	 * 登录时间
	 */
	private Date loginTime;
	
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getTenantNo() {
		return tenantNo;
	}
	public void setTenantNo(String tenantNo) {
		this.tenantNo = tenantNo;
	}
	public Set<String> getPermissions() {
		return permissions;
	}

	public void setPermissions(Set<String> permissionSet) {
		this.permissions = permissionSet;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getLoginName() {
		return loginName;
	}
	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}
	public Date getLoginTime() {
		return loginTime;
	}
	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}
	public String getToken() {
		return token;
	}
	public void setToken(String token) {
		this.token = token;
	}
	public UserDept getCurrentDept() {
		return currentDept;
	}
	public void setCurrentDept(UserDept currentDept) {
		this.currentDept = currentDept;
	}
	public List<UserRole> getRoleInfoSet() {
		return roleInfoSet;
	}
	public void setRoleInfoSet(List<UserRole> roleInfoSet) {
		this.roleInfoSet = roleInfoSet;
	}
	public Map<String, String> getParamMap() {
		return paramMap;
	}
	public void setParamMap(Map<String, String> paramMap) {
		this.paramMap = paramMap;
	}
	public UserDept getOwnDept() {
		return ownDept;
	}
	public void setOwnDept(UserDept ownDept) {
		this.ownDept = ownDept;
	}
	public String getCredentialId() {
		return credentialId;
	}
	public void setCredentialId(String credentialId) {
		this.credentialId = credentialId;
	}
	public Integer getJobCount() {
		return jobCount;
	}
	public void setJobCount(Integer jobCount) {
		this.jobCount = jobCount;
	}
}
